package com.example.demo.model;

public class result {

    private String message;
    private Integer status;
    private Object data;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static result success(Object data){
        return success(200,"获取成功",data);
    }

    public static result success(int status,String message,Object data){
        result r=new result();
        r.setMessage(message);
        r.setStatus(status);
        r.setData(data);
        return r;
    }

    public static result fail(Object data){
        return fail(400,"获取失败",data);
    }

    public static result fail(Integer status,String message,Object data){
        result r=new result();
        r.setStatus(status);
        r.setMessage(message);
        r.setData(data);
        return r;
    }

}
